package com.ruoyi.wb.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.wb.domain.WbClassifyYearContentThree;
import com.ruoyi.wb.mapper.WbClassifyYearContentThreeMapper;
import com.ruoyi.wb.service.IWbClassifyYearContentThreeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 维保年度类目三级表Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-18
 */
@Service
public class WbClassifyYearContentThreeServiceImpl implements IWbClassifyYearContentThreeService 
{
    @Autowired
    private WbClassifyYearContentThreeMapper wbClassifyYearContentThreeMapper;

    /**
     * 查询维保年度类目三级表
     * 
     * @param classifyContentId 维保年度类目三级表主键
     * @return 维保年度类目三级表
     */
    @Override
    public WbClassifyYearContentThree selectWbClassifyYearContentThreeByClassifyContentId(Long classifyContentId)
    {
        return wbClassifyYearContentThreeMapper.selectWbClassifyYearContentThreeByClassifyContentId(classifyContentId);
    }

    /**
     * 查询维保年度类目三级表列表
     * 
     * @param wbClassifyYearContentThree 维保年度类目三级表
     * @return 维保年度类目三级表
     */
    @Override
    public List<WbClassifyYearContentThree> selectWbClassifyYearContentThreeList(WbClassifyYearContentThree wbClassifyYearContentThree)
    {
        return wbClassifyYearContentThreeMapper.selectWbClassifyYearContentThreeList(wbClassifyYearContentThree);
    }

    /**
     * 新增维保年度类目三级表
     * 
     * @param wbClassifyYearContentThree 维保年度类目三级表
     * @return 结果
     */
    @Override
    public int insertWbClassifyYearContentThree(WbClassifyYearContentThree wbClassifyYearContentThree)
    {
        wbClassifyYearContentThree.setCreateTime(DateUtils.getNowDate());
        return wbClassifyYearContentThreeMapper.insertWbClassifyYearContentThree(wbClassifyYearContentThree);
    }

    /**
     * 修改维保年度类目三级表
     * 
     * @param wbClassifyYearContentThree 维保年度类目三级表
     * @return 结果
     */
    @Override
    public int updateWbClassifyYearContentThree(WbClassifyYearContentThree wbClassifyYearContentThree)
    {
        wbClassifyYearContentThree.setUpdateTime(DateUtils.getNowDate());
        return wbClassifyYearContentThreeMapper.updateWbClassifyYearContentThree(wbClassifyYearContentThree);
    }

    /**
     * 批量删除维保年度类目三级表
     * 
     * @param classifyContentIds 需要删除的维保年度类目三级表主键
     * @return 结果
     */
    @Override
    public int deleteWbClassifyYearContentThreeByClassifyContentIds(Long[] classifyContentIds)
    {
        return wbClassifyYearContentThreeMapper.deleteWbClassifyYearContentThreeByClassifyContentIds(classifyContentIds);
    }

    /**
     * 删除维保年度类目三级表信息
     * 
     * @param classifyContentId 维保年度类目三级表主键
     * @return 结果
     */
    @Override
    public int deleteWbClassifyYearContentThreeByClassifyContentId(Long classifyContentId)
    {
        return wbClassifyYearContentThreeMapper.deleteWbClassifyYearContentThreeByClassifyContentId(classifyContentId);
    }


    /**
     * 根据二级id查询三级
     * @param classifyContentIds
     * @return
     */
    public List<WbClassifyYearContentThree> selectWbClassifyYearContentThreeListByClassifyYearContentIds(List<Long> classifyContentIds) {
        return wbClassifyYearContentThreeMapper.selectWbClassifyYearContentThreeListByClassifyYearContentIds(classifyContentIds);
    }

    //根据二级id删除三级
    public int deleteWbClassifyYearContentThreeByParentIds(List<Long> classifyContentIds) {
        return wbClassifyYearContentThreeMapper.deleteWbClassifyYearContentThreeByParentIds(classifyContentIds);
    }
}
